package com.taxsystem.yehao.jsonParser;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.json.JSONArray;
import org.json.JSONObject;

import com.taxsystem.yehao.tool.UrlPost;

public class HallWaitDetailJsonParser {
	public static List<HashMap<String,Object>>parse(String url,Map<String,Object> params) {
		List<HashMap<String,Object>>retList = new ArrayList<HashMap<String,Object>>();
		try {
			JSONObject jsonObject = UrlPost.getJsonObject(url, new HashMap<String,Object>());
			JSONArray jsonArray=jsonObject.getJSONArray("data");
			for(int i=0;i<jsonArray.length();i++) {
				JSONObject hallWaitDetailJsonObject = jsonArray.getJSONObject(i);
				 HashMap<String,Object> map = new HashMap<String,Object>();
				 map.put("onlineCounter", hallWaitDetailJsonObject.getString("onlineCounter"));
				 map.put("ticketItemId", hallWaitDetailJsonObject.getString("ticketItemId"));
				 map.put("ticketItemName", hallWaitDetailJsonObject.getString("ticketItemName"));
				 map.put("waitingCount", hallWaitDetailJsonObject.getString("waitingCount"));
				 retList.add(map);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return retList;
	}
}
